#pragma once

#include "e2d/core/pch.h"
#include "e2d/core/physics/PxUtils.h"

namespace e2d
{
	struct  PxMaterialData
	{
		float m_StaticFriction = 0.5f;
		float m_DynamicFriction = 0.5f;
		float m_Restitution = 0.5;
	};

	struct  PxBasicMap
	{

		PxMaterialData m_MaterialData;

		e2d::Transform m_LocalPos;

		physx::PxShape* m_Shape{ 0 };

		physx::PxMaterial* m_Material{ 0 };

		void CreatMaterial();

		void SetLocalPos();

		void DeleteShape();

		void DeleteMaterial();

		void Delete();
	};

	struct PxBoxShapeMap :public PxBasicMap
	{
		e2d::BoxShape m_Box;
		
		void CreateShape();

	};

	struct PxShapeMap
	{
		std::vector<PxBoxShapeMap> m_BoxShapes;

		void Create();

		bool AttachedToRigidBody(physx::PxRigidActor* rb);

		bool DetachedToRigidBody(physx::PxRigidActor* rb);

		void Delete();
	};


};